cmake_minimum_required(VERSION 3.4.1)

include_directories(../lua)

add_definitions(-DLUA_USE_DLOPEN -DLUA_USE_C89 -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2)

set(SRC_LIST
        luasocket.c
        timeout.c
        buffer.c
        io.c
        auxiliar.c
        options.c
        inet.c
        except.c
        select.c
        tcp.c
        udp.c
        mime.c
        luasocket_scripts.c
        serial.c
        unix.c
        usocket.c
        )

add_library(luasocket SHARED ${SRC_LIST})

target_link_libraries(luasocket lua)